<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/common/common-taglib.jsp"%>

<div class="am-cf am-padding">
	<div class="am-fl am-cf">
		<strong class="am-text-primary am-text-lg">单位管理</strong> / <small>单位查询</small>
	</div>
</div>

<div class="am-g">
	<div class="am-u-md-9 am-cf">
		<div class="am-fl am-cf">
			<div class="am-btn-toolbar am-fl">
				<div class="am-btn-group am-btn-group-xs">
					<t:pril action="/unit/addUnit">
						<button type="button"
							onclick="javascript:$.AMUI.progress.start();location.href='unit/addUnit.action';"
							class="am-btn am-btn-default">
							<span class="am-icon-plus"></span> 添加单位
						</button>
					</t:pril>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="am-g">
	<div class="am-u-sm-12">
		<form class="am-form">
			<table class="am-table am-table-striped am-table-hover table-main">
				<thead>
					<tr>
						<th class="table-title">ID</th>
						<th class="table-title">单位</th>
						<th class="table-title">地址</th>
						<th class="table-detail">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.beanList}" var="unit">
						<tr>
							<td>${unit.unitId}</td>
							<td>${unit.unitName}</td>
							<td>${unit.unitAddress}</td>
							<td>
								<div class="am-btn-toolbar">
									<div class="am-btn-group am-btn-group-xs">
										<t:pril action="/unit/updateUnit">
											<button type="button" class="am-btn am-btn-default"
												onclick="javascript:$.AMUI.progress.start();location.href='unit/updateUnit.action?unitId=${unit.unitId}';">
												<span class="am-icon-trash-o"> </span> 修改
											</button>
										</t:pril>
										<t:pril action="/unit/deleteUnit">
											<button type="button" class="am-btn am-btn-default"
												onclick="deleteUnit(${unit.unitId})">
												<span class="am-icon-trash-o"> </span> 删除
											</button>
										</t:pril>
									</div>
								</div>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<!-- 页码 -->
			<%@ include file="/WEB-INF/views/common/page-index.jsp"%>
		</form>
	</div>
	<!-- 操作结果 -->
	<%@ include file="/WEB-INF/views/common/operate-message.jsp"%>
	<!-- 控制 js -->
	<script src="assets/script/unit/unit-query.js"></script>
</div>